<extend name="Public/base"/>

<block name="header">
  <li><a href="javascript:;">安装协议</a></li>
  <li><a href="javascript:;">环境检测</a></li>
  <li class="active"><a href="javascript:;">创建数据库</a></li>
  <li><a href="javascript:;"><eq name="Think.session.update" value="1">升级<else/>安装</eq></a></li>
  <li><a href="javascript:;">完成</a></li>
</block>

<block name="body">
  <?php
    defined('SAE_MYSQL_HOST_M') or define('SAE_MYSQL_HOST_M', '127.0.0.1');
    defined('SAE_MYSQL_HOST_M') or define('SAE_MYSQL_PORT', '3306');
  ?>
  <h2>创建数据库</h2>
  <form action="__SELF__" class="form-horizontal" method="post" target="_self">
    <div class="form-group">
      <label class="col-xs-2 control-label">数据库类型</label>
      <div class="col-xs-4">
        <select name="db[]" class="form-control">
          <option>mysql</option>
        </select>
      </div>
      <span class="help-block col-xs-6">一般选择mysql</span>
    </div>
    <div class="form-group">
      <label class="col-xs-2 control-label">数据库服务器</label>
      <div class="col-xs-4">
        <input type="text" name="db[]" class="form-control" value="<defined name='SAE_MYSQL_HOST_M'>{$Think.const.SAE_MYSQL_HOST_M}<else/>127.0.0.1</defined>">
      </div>
      <span class="help-block col-xs-6">数据库服务器IP，一般为127.0.0.1</span>
    </div>
    <div class="form-group">
      <label class="col-xs-2 control-label">数据库名</label>
      <div class="col-xs-4">
        <input type="text" name="db[]" class="form-control" value="<defined name='SAE_MYSQL_DB'>{$Think.const.SAE_MYSQL_DB}</defined>">
      </div>
    </div>
    <div class="form-group">
      <label class="col-xs-2 control-label">数据库用户名</label>
      <div class="col-xs-4">
        <input type="text" name="db[]" class="form-control" value="<defined name='SAE_MYSQL_USER'>{$Think.const.SAE_MYSQL_USER}</defined>">
      </div>
      <span class="help-block col-xs-6">数据库用户名，如：root</span>
    </div>
    <div class="form-group">
      <label class="col-xs-2 control-label">数据库密码</label>
      <div class="col-xs-4">
        <input type="password" name="db[]" class="form-control" value="<defined name='SAE_MYSQL_PASS'>{$Think.const.SAE_MYSQL_PASS}</defined>">
      </div>
    </div>
    <div class="form-group">
      <label class="col-xs-2 control-label">数据库端口</label>
      <div class="col-xs-4">
        <input type="text" name="db[]" class="form-control" value="<defined name='SAE_MYSQL_PORT'>{$Think.const.SAE_MYSQL_PORT}<else/>3306</defined>">
      </div>
      <span class="help-block col-xs-6">数据库服务连接端口，一般为3306</span>
    </div>
    <div class="form-group">
      <label class="col-xs-2 control-label">数据表前缀</label>
      <div class="col-xs-4">
        <input type="text" name="db[]" class="form-control" value="jipu_">
      </div>
      <span class="help-block col-xs-6">同一个数据库运行多个系统时请修改为不同的前缀</span>
    </div>

    <div class="create-database">
      <h2>创建管理员帐号</h2>
      <div class="form-group">
        <label class="col-xs-2 control-label">用户名</label>
        <div class="col-xs-4">
          <input type="text" name="admin[]" class="form-control" value="admin">
        </div>
      </div>
      <div class="form-group">
        <label class="col-xs-2 control-label">密码</label>
        <div class="col-xs-4">
          <input type="password" name="admin[]" class="form-control" value="">
        </div>
      </div>
      <div class="form-group">
        <label class="col-xs-2 control-label">确认密码</label>
        <div class="col-xs-4">
          <input type="password" name="admin[]" class="form-control" value="">
        </div>
      </div>
<!--      <div class="form-group">
        <label class="col-xs-2 control-label">邮箱</label>
        <div class="col-xs-4">
          <input type="text" name="admin[]" class="form-control" value="">
        </div>
      </div>-->
    </div>
  </form>
</block>

<block name="footer">
  <button id="submit" type="button" class="btn btn-positive btn-lg" onclick="$('form').submit();return false;">下一步</button>
  <a class="btn btn-negative btn-lg" href="{:U('Install/step1')}">返回</a>
</block>
